package com.tuanzi.blog.dao;

import com.tuanzi.blog.model.Comment;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CommentMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Comment record);

    int insertSelective(Comment record);

    Comment selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Comment record);

    int updateByPrimaryKey(Comment record);

    //通过博客id来查询聊天记录
    //这个查询还是排序的
    List<Comment> selectByBlogId(@Param("blogId")Long blogId);

    //查询孩子列表
    List<Comment> selectChildrens(@Param("id") Long id);

    //拿到所有的顶级评论
    List<Comment> selectTopByBlogId(@Param("blogId")Long blogId);
}